//
//  photoModel.m
//  艾听歌
//
//  Created by dllo on 16/5/26.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "photoModel.h"
#import "NSString+Characters.h"

@implementation photoModel

- (void)setAuditionList:(NSMutableArray *)auditionList
{
    _auditionList = auditionList;
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in auditionList) {
        PhotoDetailModel *model = [[PhotoDetailModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [array addObject:model];
    }
    _auditionList = [NSMutableArray arrayWithArray:array];
}

- (void)setUrlList:(NSMutableArray *)urlList
{
    _urlList = urlList;
    NSMutableArray *urlArray = [NSMutableArray array];
    for (NSDictionary *dic in urlList) {
        PhotoDetailModel *urlModel = [[PhotoDetailModel alloc] init];
        [urlModel setValuesForKeysWithDictionary:dic];
        [urlArray addObject:urlModel];
    }
    _urlList = [NSMutableArray arrayWithArray:urlArray];
}

//*************
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"_id"]) {
        self.mId = value;
    }
}

- (NSComparisonResult)compare:(photoModel *)singerRankModel{
    return [[self.singer_name pinyinOfName] compare:[singerRankModel.singer_name pinyinOfName]];
}



@end
